import request from '@/utils/requestUtil.js'

const BASE_URL = '/article/admin-api/article-classify'

export default {
  // 分页查询文章分类
  pageSelectArticleClassify(currentPage, pageSize, data) {
    return request({
      url: BASE_URL + `/page/${currentPage}/${pageSize}`,
      method: 'get',
      params: { ...data }
    })
  },

  // 新增文章分类
  insertArticleClassify(data) {
    return request({
      url: BASE_URL,
      method: 'post',
      data
    })
  },

  // 修改文章分类
  updateArticleClassify(data) {
    return request({
      url: BASE_URL,
      method: 'put',
      data
    })
  },

  // 删除文章分类
  deleteArticleClassify(articleClassifyId) {
    return request({
      url: BASE_URL + `/${articleClassifyId}`,
      method: 'delete'
    })
  },

  // 批量删除文章分类
  batchDeleteArticleClassify(articleClassifyIdList) {
    return request({
      url: BASE_URL + `/batch`,
      method: 'delete',
      data: articleClassifyIdList
    })
  },

  // 查询文章分类
  selectArticleClassify(data) {
    return request({
      url: BASE_URL,
      method: 'get',
      params: { ...data }
    })
  }
}
